<?php 
include '../function.php';

$str = "w.w.w";

$preg = "/ww/";

$res = preg_match($preg, $str);

// var_dump($res);


$str = "学并思官网www.xuebingsiwang.com学并思论坛  http://bbs.xuebingsiwang.com我在学并思的网名叫xuebingsi";

$preg = "/(xuebingsi)wang/";

$newStr= preg_replace($preg,"<span  style='color:#f00'>$1</span>wang",$str);
	// echo $newStr;

// $res = preg_replace($preg,"$2bb$1bb$3", $str);

// var_dump($str,$res);
// 
$str = "bsdfdksksdjf";

$preg = "/[ab]|cb/";

$res = preg_match($preg, $str);

// var_dump($res);
// 
$str = "18925139194";

$preg ="/^[0-9]{11}$/";


// 6-8，包含字母，数字，下划线，只能以字母,不能以下划线结束

$name = "xueb*in";

$preg = "/^[a-z][a-z0-9_]{4,6}[a-z0-9]$/";


$name = "19925139194";

$preg = "/^1(3[0-9]|4[124]|5[0-6])[0-9]{8}$/";


// 写一个邮箱。身份证  正则


$res = preg_match($preg, $name);

// var_dump($res);

$str = "wwww bbswWwwwwsdfbklwwwwsdfds
sdf
sdf
sdf
sdf
sd
f
sdf
sdf
f";

$preg = "/w{3,6}?/";


$res = preg_replace($preg , "xxxx", $str );

echo $res;


$str = "sdfdsf@sdrfsd@sdfsdf@sdf";

$preg = "/@/";

$res = preg_split($preg, $str);

/////////////////////
// var_dump($res); //
/////////////////////

$str = "学并思官网www.xuebingsiwang.com学并思论坛  http://bbs.xuebingsiwang.com我在学并思的网名叫xuebingsi";

$preg = "/(xuebingsi)wang/";

$newStr= preg_match_all($preg, $str, $out);


// var_dump($out);










 ?>